package com.honey.compilation.sql.ddl;

import java.util.HashMap;
import java.util.Map;

import com.honey.compilation.sql.SqlConstraint;
import com.honey.core.builder.CharacterBuilder;
import com.honey.core.builder.CharacterBuilderFactory;


/**
 * 未定义 约束 
 * @author Administrator
 *
 */
public class ConstraintUndefine extends SqlConstraint{
	
	private Map<SQLConstraintType, SqlConstraint> maps = null ;
	
	public ConstraintUndefine(){
		maps = new HashMap<SQLConstraintType, SqlConstraint>();
	}

	@Override
	public SqlConstraint getCheckConstraint() {
		return maps.get(SQLConstraintType.CHECK);
	}

	@Override
	public SqlConstraint getDefaultConstraint() {
		return maps.get(SQLConstraintType.DEFAULT);
	}

	@Override
	public SqlConstraint getNotNullConstraint() {
		return maps.get(SQLConstraintType.NOT_NULL);
	}

	@Override
	public SqlConstraint getPrimaryKeyConstraint() {
		return maps.get(SQLConstraintType.PRIMARY_KEY);
	}
	
	@Override
	public SqlConstraint getUniqueConstraint() {
		return maps.get(SQLConstraintType.UNIQUE);
	}
	
	@Override
	public void addConstraint(SqlConstraint constraint) {
		super.addConstraint(constraint);
		maps.put(constraint.getSQLConstraintType(), constraint);
	}
	
	@Override
	public SQLConstraintType getSQLConstraintType() {
		return SQLConstraintType.UNDEFINE;
	}
	
	@Override
	public CharacterBuilder compiledContent(int indentLevel) {
		return  CharacterBuilderFactory.createC16StringBuilder();
	}

}
